<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
JSJaC Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="JSJaCKeys.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b>JSJaC</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>JSJaCKeys.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'JSJaCKeys.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="JSJaCKeys.html">JSJaCKeys</a></b></td>
    <td>Reflects a set of sha1/md5 hash keys for securing sessions
 </td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview">
<span class="comment">/**
 * Creates a new set of hash keys
 * <span class="attrib">@class</span> Reflects a set of sha1/md5 hash keys for securing sessions
 * <span class="attrib">@constructor</span>
 * <span class="attrib">@param</span> {Function} func The hash function to be used for creating the keys
 * <span class="attrib">@param</span> {Debugger} oDbg Reference to debugger implementation [optional]
 */</span>									 
<span class="reserved">function</span> JSJaCKeys(func,oDbg) {
  var seed = Math.random();

  <span class="comment">/**
   * <span class="attrib">@private</span>
   */</span>
  <span class="reserved">this</span>._k = new Array();
  <span class="reserved">this</span>._k[0] = seed.toString();
  <span class="reserved">if</span> (oDbg)
    <span class="comment">/**
     * Reference to Debugger
     * <span class="attrib">@type</span> Debugger
     */</span>
    <span class="reserved">this</span>.oDbg = oDbg;
  <span class="reserved">else</span> {
    <span class="reserved">this</span>.oDbg = {};
    <span class="reserved">this</span>.oDbg.log = <span class="reserved">function</span>() {};
  }

  <span class="reserved">if</span> (func) {
    <span class="reserved">for</span> (var i=1; i&lt;JSJAC_NKEYS; i++) {
      <span class="reserved">this</span>._k[i] = func(<span class="reserved">this</span>._k[i-1]);
      oDbg.log(i+<span class="literal">": "</span>+<span class="reserved">this</span>._k[i],4);
    }
  }

  <span class="comment">/**
   * <span class="attrib">@private</span>
   */</span>
  <span class="reserved">this</span>._indexAt = JSJAC_NKEYS-1;
  <span class="comment">/**
   * Gets next key from stack
   * <span class="attrib">@return</span> New hash key
   * <span class="attrib">@type</span> String
   */</span>
  <span class="reserved">this</span>.getKey = <span class="reserved">function</span>() {
    <span class="reserved">return</span> <span class="reserved">this</span>._k[<span class="reserved">this</span>._indexAt--];
  };
  <span class="comment">/**
   * Indicates whether there's only one key left
   * <span class="attrib">@return</span> &lt;code&gt;true&lt;/code&gt; if there's only one key left, false otherwise
   * <span class="attrib">@type</span> boolean
   */</span>
  <span class="reserved">this</span>.lastKey = <span class="reserved">function</span>() { <span class="reserved">return</span> (<span class="reserved">this</span>._indexAt == 0); };
  <span class="comment">/**
   * Returns number of overall/initial stack size
   * <span class="attrib">@return</span> Number of keys created
   * <span class="attrib">@type</span> int
   */</span>
  <span class="reserved">this</span>.size = <span class="reserved">function</span>() { <span class="reserved">return</span> <span class="reserved">this</span>._k.length; };

  <span class="comment">/**
   * <span class="attrib">@private</span>
   */</span>
  <span class="reserved">this</span>._getSuspendVars = <span class="reserved">function</span>() {
    <span class="reserved">return</span> (<span class="literal">'_k,_indexAt'</span>).split(<span class="literal">','</span>);
  }
}
</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b>JSJaC</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Tue Feb 12 18:46:55 2008</div>
</body>
</html>
